<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>折叠菜单</title>

    <style>
        body {
            margin-left: 200px;
        }

        .liOut {
            display: flex;
            flex-direction: column;
            flex: 1;
            width: 200px;
            height: 100%;
            background-color: aqua;
        }

        .lv1 {
            width: 200px;
            height: 30px;
            display: flex;
            background-color: lightgreen;
        }

        .liIn {
            width: 200px;
            height: 30px;
            background-color: gold;
        }
    </style>
    <script src="../node_modules/jquery/dist/jquery.js"></script>

    <script>

        $(() => {
            //  添加上css
            $('div').children()
                .has('li')
                .has('ul')
                .has('li')
                .addClass('liIn')

            var a = $('div')
                .children()
                .has('li')
                .has('a')
            a.click(() => {
                $('div')
                    .children()
                    .has('li')
                    .has('a')
                    .has('li').animate({ "fontSize": '200px' })
            })
        })


    </script>
</head>

<body>
    <div class="liOut">
        <li>
            <a href="" class="lv1">1</a>
            <ul>
                <li class="liIn"><a target="_blank" rel="noopener noreferrer">1</a></li>
                <li class="liIn"><a target="_blank" rel="noopener noreferrer">2</a></li>
            </ul>
        </li>

        <!-- <li>
            <a href="" class="lv1">2</a>
            <ul>

            </ul>

            <a href="" class="lv1">3</a>
            <ul>

            </ul>
        </li>

        <li>
            <a href="" class="lv1">4</a>
            <ul>

            </ul>
        </li>
    </div> -->






</body>

</html>